def move(n, a, b, c):
    time = 0
    if n == 1:
        print(a, '->', c)
        time += 1
    else:
        time += move(n-1, a, c, b)
        print(a, '->', c)
        time += 1
        time += move(n-1, b, a, c)
        return( time )
move(3,'a', 'b', 'c')